package com.wuze.cloud.controller;

import com.wuze.cloud.request.SysRecyclingQuery;
import com.wuze.cloud.request.SysRestoreOrDelQuery;
import com.wuze.cloud.response.SysFileVO;
import com.wuze.cloud.response.SysRecyclingResponse;
import com.wuze.cloud.result.Result;
import com.wuze.cloud.service.SysFolderService;
import com.wuze.cloud.service.SysRecyclingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author wuze
 * @Date 2023/5/9 23:05
 * @ClassName: SysRecyclingController
 * @Description: TODO
 */
@RestController
public class SysRecyclingController {

    public static final String PREFIX_PATH = "/sys/recycling/";

    @Autowired
    private SysRecyclingService recyclingService;

    @Autowired
    private SysFolderService folderService;


    @PostMapping(PREFIX_PATH+"findByPage/v1")
    public Result<SysRecyclingResponse> findByPage(@RequestBody SysRecyclingQuery query){
        return Result.success(recyclingService.findByPage(query));
    }


    @PostMapping(PREFIX_PATH+"findListById/v1")
    public Result<List<SysFileVO>> findListById(@RequestBody SysRecyclingQuery query){
        return Result.success(recyclingService.findListById(query));
    }

    @PostMapping(PREFIX_PATH+"restoreOrDel/v1")
    public Result<Boolean> restoreOrDel(@RequestBody SysRestoreOrDelQuery query){
        recyclingService.restoreOrDel(query);
        return Result.success(Boolean.TRUE);
    }

}
